{extend name="common" /}

{block name="content"}
<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">

        <div class="layui-form-item">
            <label class="layui-form-label">任务标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" class="layui-input" lay-verify="required" lay-reqtext="任务标题不能为空"
                       placeholder="请输入任务标题" value="">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">任务类型</label>
            <div class="layui-input-block">
                <select class="layui-select" name="type" lay-verify="required">
                    <option>请选择任务类型</option>
                    {foreach $typeOptions as $k=>$v}
                    <option value='{$k}'>{$v}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">Cron规则</label>
            <div class="layui-input-block">
                <input type="text" name="rule" class="layui-input" lay-verify="required" lay-reqtext="任务执行表达式不能为空"
                       placeholder="请输入任务执行表达式" value="* * * * * *">
                <blockquote class="layui-elem-quote" style="border-left: none;margin-top: 7px;">
                    <pre><code>*   *   *   *   *   *
-   -   -   -   -   -
|   |   |   |   |   +------ 天或者星期 (0 - 6) (星期天=0)
|   |   |   |   +---------- 月 (1 - 12)
|   |   |   +-------------- 天 (1 - 31)
|   |   +------------------ 小时 (0 - 23)
|   +---------------------- 分钟 (0 - 59)
+-------------------------- 秒 (0-59)[可省略，如果没有0位,则最小时间粒度是分钟]</code></pre>
                </blockquote>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">调用目标</label>
            <div class="layui-input-block">
                <input type="text" name="target" class="layui-input" lay-verify="required" lay-reqtext="调用任务字符串不能为空"
                       placeholder="请输入调用任务字符串" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">调用参数</label>
            <div class="layui-input-block">
                <textarea name="parameter" class="layui-textarea" placeholder="请输入调用参数 url和shell和sql任务参数无效"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" name="sort" class="layui-input" lay-verify="number" lay-reqtext="排序不能为空"
                       placeholder="请输入排序" value="0">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="0" title="禁用">
                <input type="radio" name="status" value="1" title="启用" checked>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否单次执行</label>
            <div class="layui-input-block">
                <input type="radio" name="singleton" value="0" title="是" checked>
                <input type="radio" name="singleton" value="1" title="否">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="remark" class="layui-textarea" placeholder="请输入备注信息"></textarea>
            </div>
        </div>


        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>
{/block}
